<template>
<!--    <div>-->

        <van-form>
            <template v-for="v in fields">
                <text.vue v-if="v.leipiplugins === 'text'" :option="v" />
                <textarea.vue v-if="v.leipiplugins === 'textarea'" :option="v"/>
                <checkboxs v-if="v.leipiplugins === 'checkboxs'" :option="v"/>
                <radio.vue v-if="v.leipiplugins === 'radios' || v.leipiplugins === 'select'" :option="v"/>
                <date v-if="v.leipiplugins === 'datetime'" :option="v"/>
                <sign v-if="v.leipiplugins === 'sign'" :option="v" />
                <macros v-if="v.leipiplugins === 'macros'" :option="v"/>
            </template>
        </van-form>
<!--    </div>-->
</template>

<script>
    import Text from "./form/text"
    import Textarea from "./form/textarea"
    import Checkboxs from "./form/checkboxs"
    import Radio from "./form/radio";
    import DDate from "./form/date";
    import Sign from "./form/sign";
    import Macros from "./form/macros";
    export default {
        name: "form.vue",
        components: {
            Macros,
            Sign, date: DDate, "textarea.vue": Textarea, "text.vue": Text, "checkboxs": Checkboxs, "radio.vue": Radio},
        props:{
            fields:{
                type: Array,
                default(){
                    return []
                }
            }
        },
        watch:{
            fields(nv){
                console.log(nv)
            }
        },
        data(){
            return {
                data: {}
            }
        },
        methods:{



        },
        mounted() {
            // var id = this.$route.query.id
            // this.load(id)
            // console.log(this.$route.quer)
        }
    }
</script>

<style scoped>
</style>